package br.cin.stadium.middleware.marshall;

import br.cin.stadium.middleware.FormatException;

/**
 * All classes that can be store/write in the space need to implement this interface.
 * Can be used to others classes that need to be transfer through network layer
 * <br>
 * GRASP pattern to give responsibility to class that can handle its data.
 *  
 * @author Jorge, Fabiano, Rafael, Vando
 */
public interface Serializable {
	
    /**
     * Calls to converter to an unstructed form (byte[]) and store it in the MarshallOutputStream parameter.
     * @param mos MarshallOutput middleware specific stream
     * @throws FormatException Error format exception
     */
    public void marshal(MarshallOutputStream mos) throws FormatException;
    
    /**
     * Calls to converter to a structed form - depends on the caller.
     * @param mos MarshallInput middleware specific stream
     * @throws FormatException Error format exception
     */
    public void unmarshal(MarshallInputStream mis) throws FormatException;

}
